package org.example.cicdi.enums;

import org.apache.commons.codec.binary.StringUtils;

public enum EnumWhiteColumnAnnotation {

    Column(1, "Column","JPA"),
    
    ManyToOne(2, "ManyToOne","JPA"),
    
    PageVo(2, "PageVo","SELF"),
    
    DbVo(2, "DbVo","SELF"),
	ValidateVo(4,"ValidateVo","SELF"),
	ForeignVo(5,"ForeignVo","SELF"),
	IndexVo(6,"IndexVo","SELF"),
	SearchVo(7,"SearchVo","SELF")

    ;
	
	Integer type;

    String code;
    
    String source;

    EnumWhiteColumnAnnotation(int type, String code, String source) {
        this.type = type;
        this.code = code;
        this.source = source;
    }

    public static EnumWhiteColumnAnnotation getByCode(String code) {
    	for (EnumWhiteColumnAnnotation en : EnumWhiteColumnAnnotation.values()) {
    		if (StringUtils.equals(en.getCode(), code)) {
    			return en;
    		}
    	}
    	
    	return null;
    }

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getSource() {
		return source;
	}

	public void setSource(String source) {
		this.source = source;
	}
}
